#include <vector>
#include "test.hpp"
#include "return_value_behavior.hpp"
#include "argument_matcher.hpp"
#include "exact_argument_matcher.hpp"
#include "unexpected_invocation_exception.hpp"

using std::vector;

namespace vimock {
TEST_CASE(replay_should_return_return_value_set_when_invocation_match)
{
	object obj(1);
	object func(2);
	argument_matcher_vector argument_matchers(new vector<argument_matcher>());
	invocation_matcher inv_matcher(new _invocation_matcher(obj, func, argument_matchers));
	object_vector arguments(new vector<object>());
	invocation inv(new _invocation(obj, func, arguments));

	return_value_behavior behavior(inv_matcher, 100);
	assert_are_equal(100, behavior.replay(inv).to<int>());
}
TEST_CASE(replay_return_value_behavior_should_throw_unexpected_invocation_exception_when_invocation_mismatch)
{
	argument_matcher_vector argument_matchers(new vector<argument_matcher>());
	invocation_matcher inv_matcher(new _invocation_matcher(0, 0, argument_matchers));
	object_vector arguments(new vector<object>());
	invocation inv(new _invocation(1, 1, arguments));

	return_value_behavior behavior(inv_matcher, 100);
	assert_thrown(unexpected_invocation_exception, behavior.replay(inv));
}
}
